import type { GetCodeData, GetCodeParams, LoginCodeParams, LoginData, LoginParams, UserData } from "@/types/user";
import { request } from "@/utils/http";


// 1. 登录
export const loginApi = (data: LoginParams) => request.post<null, LoginData>('/login/password', data)

// 获取验证码登录
export const getCodeApi = (params: GetCodeParams) => request.get<null, GetCodeData>('/code', {params})

// 3. 验证码登录
export const loginByMobileApi = (data: LoginCodeParams) => request.post<null, LoginData>('/login', data)

// 获取个人信息
export const userInfoApi = () => {return request.get<null, UserData>('/patient/myUser')}